import base from '@/api/baseurl';
import request from '@/utils/request'

/**
 * 主表查询
 * @param {*} query gs_s_code 生成方案编号  gs_s_name 生成方案名称 
 * @returns
 */
 export function findSplicing(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/splicing/findSplicing',
    method: 'get',
    params: query
  })
}

/**
 * 编码自增
 * @param {*} query 
 * @returns
 */
 export function addgsMaCode(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/splicing/addgs_ma_code',
    method: 'get',
    params: query
  })
}

/**
 * 主表新增
 * @param {*} data
 * @returns
 */
 export function addSplicing(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/splicing/addSplicing',
    method: 'post',
    data
  })
}


/**
 * 生成曲线类型select数据
 * @param {*} query 
 * @returns
 */
 export function findcvtype(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/movingverage/findcvtype',
    method: 'get',
    params: query
  })
}



/**
 * 同步数据
 * @param {*} query
 * @returns
 */
export function splicinggenerate(query={}) {
  return request({
    baseURL: base.appBaseApi,
    url: '/splicing/splicinggenerate',
    method: 'get',
    params: query
  })
}



//---------------------------------------------
/**
 * 主表查询
 * @param {*} query
 * @returns
 */
export function findtransferPriceFactor(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpf/like',
    method: 'get',
    params: query
  })
}

/**
 * 主表新增
 * @param {*} data
 * @returns
 */
export function addtransferPriceFactor(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpf/add',
    method: 'post',
    data
  })
}

/**
 * 主表修改
 * @param {*} data
 * @returns
 */
export function updateSplicing(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/splicing/updateSplicing',
    method: 'post',
    data
  })
}

/**
 * 主表删除
 * @param {*} data
 * @returns
 */
export function deleteSplicing(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/splicing/deleteSplicing',
    method: 'get',
    params: query
  })
}

//法人下拉框
export function fetchListuserlp(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpf/find_lpCode',
    method: 'get',
    params: query
  })
}



/**
 * 转移价格调整因子
 * @param {*} query 
 * @returns   adj_ft_code 因子编号
 */
export function codeAutoIncrement(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpf/codeAutoIncrement',
    method: 'get',
    params: query
  })
}